/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: Configuration Management
 *
 *  Author: Amlogic Software
 *  Created: 3/29/2006 4:59PM
 *
 *******************************************************************/

#ifndef AW_CONFIG_H
#define AW_CONFIG_H

//#include <netinet/in.h>

//typedef struct {
//    unsigned        dhcpEnabled;
//    struct in_addr  ip_addr;
//    struct in_addr  netmask;
//    struct in_addr  gw_addr;
//    struct in_addr  dns_addr
//} network_config_t;
#ifdef ENABLE_NETWORK
#include "aw_network.h"
#endif /* ENABLE_NETWORK */

INT8U GetJpegPlayModePara(void);
void SetJpegPlayModePara(INT8U);

void ClearParaInit();

void SetParaInit(void );
INT8U GetParaInit(void);

void SetLanguagePara(INT8U );
INT8U GetLanguagePara(void);

void SetSlideDurPara(INT8U );
INT8U GetSlideDurPara(void);

void SetSlideModePara(INT8U );
INT8U GetSlideModePara(void);

void SetMusicRepeatModePara(INT8U );
INT8U GetMusicRepeatModePara(void);

void SetMovieRepeatModePara(INT8U );
INT8U GetMovieRepeatModePara(void);

void SetDisplayModePara(INT8U );
INT8U GetDisplayModePara(void);

void SetTVOutPutModePara(INT8U OutPutmode);
INT8U GetTVOutPutModePara(void);

void SetAutoRunPara(INT8U autorun);
INT8U GetAutoRunPara(void);

#ifdef RESUME_PLAY
void GetResumeFilePara(char *file_info);
void SetResumeFilePara(char *file_info);
INT32U  GetResumeTimePara(void);
void SetResumeTimePara(INT32U resume_filetime);
INT8U GetResumePlayFlagPara(void);
void SetResumePlayFlagPara(INT8U resumeplayflag);
#endif

extern int aw_config_init();
//extern int aw_config_get_mac_addr(unsigned char *addr);
//extern int aw_config_put_mac_addr(unsigned char *addr);
//extern int aw_config_get_net_cfg(network_config_t *addr);
//extern int aw_config_put_net_cfg(network_config_t *addr);
extern int aw_config_get_lanuage_addr(unsigned char *addr);
extern int aw_config_put_lanuage_addr(unsigned char *addr);
extern int  Musicrepeat_mode_flag_extern;
extern int  Movierepeat_mode_flag_extern;
#define gpio_set_FEC_high(pin)  {gpio_set_fec(pin, TRUE);}
#define gpio_set_FEC_low(pin)   {gpio_set_fec(pin, FALSE);}
#define gpio_get_FEC(pin,level) {level = gpio_get_fec(pin);}

void SetSoundLevelPara(INT8U Sound_level_index);

#ifdef ENABLE_BLUETOOTH
extern void GetBtPinCode(void);
extern void SetBtPinCode(void);
extern void SetBtPinCodeByCustomer(char* customer_pin);
extern void SetBtDefaultPinCode(void);
extern void GetBtLinkKey(void);
extern void SetBtLinkKey(void);
#endif
#ifdef ENABLE_NETWORK
extern u8_t yahoo_auto_enable;
extern u8_t google_auto_enable;
extern u8_t framechannel_auto_enable;

unsigned char GetNetEnablePara(void);
void          SetNetEnablePara(unsigned char enable_flag);

int GetNetConfig(struct aml_netif_setting *config);
int SetNetConfig(struct aml_netif_setting *config);

INT8U GetMenuNetRssPara(void);
int   SetMenuNetRssPara(INT8U NetRss_flag);

int GetWifiConfig(struct aml_iw_config *config);
int SetWifiConfig(struct aml_iw_config *config);

unsigned char GetYahooAutoEnable(char *enable);

unsigned char GetYahooConfig(yahoo_login_info_t *login);
unsigned char SetYahooConfig(yahoo_login_info_t *login);

unsigned char GetGoogleAutoEnable(char * enable);

unsigned char SetGoogleConfig(google_login_info_t *login);

unsigned char SetFrameChannelAutoEnable(unsigned char enable);

unsigned char SetFrameChannelConfig(framechannel_login_info_t *login);

//unsigned char *GetFlickrFullToken(unsigned char* short_token);
//void SetFlickrFullToken(unsigned char *full_token);

#endif

#endif /* AW_CONFIG_H */